var o, i, a, r, e = require, t = module, n = exports;

Object.defineProperty(n, "__esModule", {
    value: !0
}), n.FireType = n.ArmType = n.ArmState = n.PlayerState = n.BufferType = void 0, 
function(t) {
    t[t["无敌"] = 0] = "无敌", t[t["冰冻"] = 1] = "冰冻", t[t["电击"] = 2] = "电击", t[t["击飞"] = 3] = "击飞", 
    t[t["切割"] = 4] = "切割", t[t["冷却"] = 5] = "冷却", t[t["装弹"] = 6] = "装弹", t[t["停顿"] = 7] = "停顿", 
    t[t["移动"] = 8] = "移动", t[t["受伤"] = 9] = "受伤", t[t["加血"] = 10] = "加血", t[t["加攻"] = 11] = "加攻", 
    t[t["加速"] = 12] = "加速", t[t["月饼"] = 13] = "月饼", t[t["变身"] = 14] = "变身", t[t["执行"] = 15] = "执行", 
    t[t["狗头"] = 16] = "狗头", t[t["眩晕"] = 17] = "眩晕", t[t["减伤"] = 18] = "减伤", t[t["隐身"] = 19] = "隐身", 
    t[t["护盾"] = 20] = "护盾", t[t["冲击"] = 21] = "冲击", t[t["施放"] = 22] = "施放", t[t["蓄力"] = 23] = "蓄力", 
    t[t["瞄准"] = 24] = "瞄准", t[t["固定"] = 25] = "固定", t[t["隐藏中"] = 26] = "隐藏中", t[t["暴露中"] = 27] = "暴露中";
}(o = n.BufferType || (n.BufferType = {})), function(t) {
    t[t["正常"] = 0] = "正常", t[t["死亡"] = 1] = "死亡";
}(i = n.PlayerState || (n.PlayerState = {})), function(t) {
    t[t["正常"] = 0] = "正常", t[t["冰冻"] = 1] = "冰冻";
}(n.ArmState || (n.ArmState = {})), function(t) {
    t[t["正常"] = 0] = "正常", t[t["手枪"] = 1] = "手枪", t[t["冲锋枪"] = 2] = "冲锋枪", t[t["暴力枪"] = 3] = "暴力枪", 
    t[t["狙击枪"] = 4] = "狙击枪", t[t["加特林"] = 5] = "加特林", t[t["闪电枪"] = 6] = "闪电枪", t[t["科技枪"] = 7] = "科技枪", 
    t[t["导弹枪"] = 8] = "导弹枪", t[t["激光枪"] = 9] = "激光枪", t[t["冰冻枪"] = 10] = "冰冻枪", t[t["彩蛋枪"] = 11] = "彩蛋枪", 
    t[t["反弹枪"] = 12] = "反弹枪", t[t["火焰枪"] = 13] = "火焰枪", t[t["旋风枪"] = 14] = "旋风枪", t[t["炎弹枪"] = 15] = "炎弹枪", 
    t[t["闪雷枪"] = 16] = "闪雷枪", t[t["切割"] = 17] = "切割", t[t["火球"] = 18] = "火球", t[t["落雷"] = 19] = "落雷", 
    t[t["回旋"] = 20] = "回旋", t[t["毒液"] = 21] = "毒液", t[t["冲击"] = 22] = "冲击", t[t["追踪"] = 23] = "追踪", 
    t[t["旋风"] = 24] = "旋风", t[t["炎弹"] = 25] = "炎弹", t[t["闪雷"] = 26] = "闪雷";
}(a = n.ArmType || (n.ArmType = {})), function(t) {
    t[t["手枪"] = 0] = "手枪", t[t["冲锋枪"] = 1] = "冲锋枪", t[t["暴力枪"] = 2] = "暴力枪", t[t["狙击枪"] = 3] = "狙击枪", 
    t[t["加特林"] = 4] = "加特林", t[t["闪电枪"] = 5] = "闪电枪", t[t["科技枪"] = 6] = "科技枪", t[t["导弹枪"] = 7] = "导弹枪", 
    t[t["激光枪"] = 8] = "激光枪", t[t["落冰枪"] = 9] = "落冰枪", t[t["彩蛋枪"] = 10] = "彩蛋枪";
}(r = n.FireType || (n.FireType = {}));

var s = function() {
    function t(t) {
        this.openid = "", this.icon = "", this.nickname = "", this.group = 0, this.personIdx = 0, 
        this.gunIdx = 0, this.petIdx = -1, this.machineIdx = -1, this.backEquipIdx = -1, 
        this.headEquipIdx = -1, this.equipDataList = [], this.think = 1, this.MAX_HP = 2e3, 
        this.ATK = 0, this.ATK_ORG = 0, this.SPE = 200, this.SPE_ORG = 200, this.RAN = 600, 
        this.CRI = 0, this.IDLE = .1, this.ROT = 10, this.MOV = 1200, this.bullet = 0, this.fire = r.手枪, 
        this.type = a.正常, this.num = 1, this.total = 10, this.time = 1, this.pow = 5, this.miss = 0, 
        this.rank = 0, this.kill_count = 0, this.is_mvp = 0, this.is_win = 0, this.state = i.正常, 
        this.HP = 2e3, this.count = 0, this.hurtCount = 0, this.buffers = new Map(), t && (t.HP && (this.MAX_HP = this.HP = t.HP), 
        t.ATK && (this.ATK = t.ATK), t.SPE && (this.SPE = t.SPE), t.RAN && (this.RAN = t.RAN), 
        t.CRI && (this.CRI = t.CRI), t.IDLE && (this.IDLE = t.IDLE));
    }
    return t.prototype.hasBuffer = function(t) {
        return this.buffers.has(t);
    }, t.prototype.addBuffer = function(t, s) {
        var i;
        isNaN(s) || !this.hasBuffer(t) ? this.buffers.set(t, s) : (i = this.buffers.get(t), 
        (isNaN(i) || i < s) && this.buffers.set(t, s));
    }, t.prototype.removeBuffer = function(t) {
        this.buffers.delete(t);
    }, t.prototype.updateBuffer = function(i) {
        var h = this;
        this.buffers.forEach(function(t, s) {
            isNaN(t) || ((t -= i) <= 0 ? h.buffers.delete(s) : h.buffers.set(s, t));
        });
    }, t.prototype.canFinded = function() {
        return !this.isDead() && !this.hasBuffer(o.无敌) && !this.hasBuffer(o.隐身);
    }, t.prototype.canMove = function() {
        return !(this.isDead() || this.hasBuffer(o.冰冻) || this.hasBuffer(o.电击) || this.hasBuffer(o.击飞) || this.hasBuffer(o.变身) || this.hasBuffer(o.执行) || this.hasBuffer(o.眩晕) || this.hasBuffer(o.瞄准) || this.hasBuffer(o.固定));
    }, t.prototype.canAttack = function() {
        return !(this.isDead() || this.hasBuffer(o.冰冻) || this.hasBuffer(o.电击) || this.hasBuffer(o.冷却) || this.hasBuffer(o.装弹) || this.hasBuffer(o.击飞) || this.hasBuffer(o.月饼) || this.hasBuffer(o.狗头) || this.hasBuffer(o.变身) || this.hasBuffer(o.眩晕) || this.hasBuffer(o.瞄准) || this.hasBuffer(o.蓄力) || this.hasBuffer(o.固定));
    }, t.prototype.canDoAttack = function() {
        return !(this.isDead() || this.hasBuffer(o.冰冻) || this.hasBuffer(o.电击) || this.hasBuffer(o.击飞) || this.hasBuffer(o.月饼) || this.hasBuffer(o.狗头) || this.hasBuffer(o.变身) || this.hasBuffer(o.眩晕));
    }, t.prototype.canHurt = function() {
        return !this.isDead() && !this.hasBuffer(o.无敌);
    }, t.prototype.canShowGun = function() {
        return !(this.isDead() || this.hasBuffer(o.冰冻) || this.hasBuffer(o.电击) || this.hasBuffer(o.击飞) || this.hasBuffer(o.月饼) || this.hasBuffer(o.狗头) || this.hasBuffer(o.变身));
    }, t.prototype.doHurt = function(t) {
        this.hasBuffer(o.减伤) && (t = Math.round(.5 * t)), this.hasBuffer(o.狗头) ? this.HP > t + this.HP / 10 ? this.HP -= t : this.HP = Math.round(this.HP / 10) : this.HP > t ? this.HP -= t : (this.HP = 0, 
        this.state = i.死亡);
    }, t.prototype.isCri = function(t) {
        return 100 <= t || 100 * Math.random() < t;
    }, t.prototype.isDead = function() {
        return this.state == i.死亡;
    }, t.prototype.restart = function() {
        this.HP = this.MAX_HP, this.state = i.正常, this.clearCount();
    }, t.prototype.addCount = function(t) {
        return this.count += t, this.count >= this.total;
    }, t.prototype.getCount = function() {
        var t = this.total - this.count;
        return t > this.num ? this.num : t;
    }, t.prototype.clearCount = function() {
        this.count = 0;
    }, t;
}();

n.default = s;